package com.ht.pms.core.service.job;

import com.ht.pms.core.common.cache.SalaryServiceCache;
import com.ht.pms.core.dto.poi.SalaryUploadParam;
import com.ht.pms.core.dto.send.MailReqDto;
import com.ht.pms.core.dto.send.SendBaseDto;
import com.ht.pms.core.dto.send.SendGroupTempDto;
import com.ht.pms.core.service.SalaryEmailService;
import com.ht.pms.core.service.SalaryExcelDataService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ThreadManager {
    private static final Logger logger = LoggerFactory.getLogger(ThreadManager.class);

    @Autowired
    private SalaryEmailService salaryEmailService;
    @Autowired
    private SalaryExcelDataService salaryExcelDataService;
    @Autowired
    private SalaryServiceCache salaryServiceCache;

    public Runnable createEamilThread(List<SendBaseDto> sendBaseDtoList, SendGroupTempDto sendGroupTempDto) {
            return new EmailSendThread(salaryEmailService, sendBaseDtoList, sendGroupTempDto);

    }


    public Runnable createExcelImportThread(SalaryUploadParam req, Long processCode) {
        return new ExcelImportThread(req, processCode, salaryExcelDataService, salaryServiceCache);
    }
}
